# -*- coding: utf-8 -*-
import top.api
import json
import re

with open('hmm2.txt', 'r') as f:
    data = f.read()

ret = re.compile(r'picture_id\": (\d*?),')

data = ret.findall(data)
print(data)
with open('delete.txt', 'a') as f:
    for _ in data:
        f.write(_ + '\n')
"""
for ids in data:
    url = 'http://gw.api.taobao.com/router/rest'
    port = '80'
    appkey = '23656735'
    secret = '91400648c84ddd33f32dd9181d5f14c8'
    sessionkey = '620281281f27bfa430e3ZZcc4f438a274819675e989696e552522139'
     
    req=top.api.PictureDeleteRequest()
    req.set_app_info(top.appinfo(appkey,secret))
    req.picture_ids= int(ids)
    try:
        resp= req.getResponse(sessionkey)
        print(resp)
    except Exception,e:
        print(e)
"""
